package com.example.spring.ai.tools;

import com.example.spring.ai.record.WeatherRequest;
import com.example.spring.ai.record.WeatherResponse;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;

import java.util.function.Function;

@Configuration(proxyBeanMethods = false)
public class WeatherTools {

    public static final String CURRENT_WEATHER_TOOL = "currentWeather";

    WeatherService weatherService = new WeatherService();

    @Bean(CURRENT_WEATHER_TOOL)
    @Description("获取当地的天气")
    Function<WeatherRequest, WeatherResponse> currentWeather() {
        return weatherService;
    }
}
